﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SetPosition : MonoBehaviour
{
    public Transform @object;
    public Transform target;
    public MonoBehaviour[] monoDisables;
    public Collider[] colliderDisables;
    public void Invoke()
    {
        foreach (var item in monoDisables)
        {
            item.enabled = false;
        }
        foreach (var item in colliderDisables)
        {
            item.enabled = false;
        }
        @object.transform.position = target.position;
        foreach (var item in monoDisables)
        {
            item.enabled = true;
        }
        foreach (var item in colliderDisables)
        {
            item.enabled = true;
        }
    }
}
